<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>



<script>
    var res = window.confirm("点击确定还是取消");
    if (res == true){
        alert("你点击了确定")
    }else{
        alert("你点击了取消")
    }

</script>

</body>
</html>